const app = getApp();

/**
 * @description: 获取扫码后设备信息
 * @param {*} code
 * @return {*}
 */
export const getCabinetInfo = (cabinet_number) =>
  app.post("/device/cabinet_info/", { cabinet_number }, true);

/**
 * @description: 创建租借订单
 * @return {*}
 */

export const createDepositOrder = (data) =>
  app.post("/device/create_deposit_order/", data, {
    isLoading: true,
    isErrorToast: false,
  });

/**
 * @description: 获取支付成功后的设备信息
 * @return {*}
 */

export const getRentalDeviceInfo = (order_number) =>
  app.get(`/device/rental_device_info/?order_number=${order_number}`, true);
